Skip to content

Publish v0.1 envelope JSON Schema + tx-protocol 0.1.0-alpha.2 release#2

Merged
mike-diamond merged 2 commits into
mainfrom
chore/publish-erc-schema-v0.1
May 12, 2026
Merged

Publish v0.1 envelope JSON Schema + tx-protocol 0.1.0-alpha.2 release#2
mike-diamond merged 2 commits into
mainfrom
chore/publish-erc-schema-v0.1

Conversation

@mike-diamond
Copy link
Copy Markdown
Contributor

Summary

  • Publishes the PreparedTransaction Envelope v0.1 JSON Schema at the canonical URL https://txkit.dev/schemas/v0.1/envelope.json (served from app/landing/public/)
  • Adds zod-to-json-schema-based generator (pnpm --filter @txkit/tx-protocol gen:schema) so future v0.N schema revisions stay in lockstep with the zod source of truth
  • Releases @txkit/tx-protocol@0.1.0-alpha.2 with 5 breaking changes aligning the reference implementation with the ERC submission draft body (drop version field, drop unverifiable PQ scheme enum entries, rename smart-account-7702 to delegated-eoa, close severity + verdict enums)
  • Ships examples/multicall-batch.ts covering the evm-batch kind with atomicRequired + multi-call tokenMovements

Why now

The ERC submission draft (PreparedTransaction Envelope, scheduled for ethereum/ERCs PR in Phase 6) carries a normative reference to the canonical schema URL in Specification section 1.2. Until this PR ships, that URL returns 404. Phase 5 pre-Magicians soft outreach (starting today, 2026-05-12) shares the draft body with named reviewers via gist; reviewers who follow the $schema link from the worked Permit2 example or anywhere else would land on a broken URL. Publishing the schema artifact closes that gap and lets reviewers validate envelope payloads against an authoritative document.

The alpha.2 release was documented in STATUS.md as a Phase 6 prerequisite and is bundled here because the regenerated schema must reflect the post-bump zod source (no version field, renamed account type, closed enums).

Changes

Schema generator

  • packages/tx-protocol/scripts/generate-schema.ts - calls zodToJsonSchema(preparedEnvelopeSchema), augments with $schema (JSON Schema 2020-12) + $id (canonical txkit.dev URL) + title + description, writes to landing app
  • packages/tx-protocol/package.json - adds gen:schema npm script + zod-to-json-schema + tsx devDeps

Published schema artifact

  • app/landing/public/schemas/v0.1/envelope.json - 29KB JSON Schema covering all three normative kinds (evm-tx, evm-batch, signature) plus every field defined in ERC sections 1 through 10

Reference implementation alignment (@txkit/tx-protocol 0.1.0-alpha.0 -> 0.1.0-alpha.2)

  1. Drop version: SpecVersion from BaseEnvelope. The $schema URL is the version contract.
  2. Drop PQ scheme enum entries (ml-dsa-*, slh-dsa-*) from SignatureScheme. Open string fallback covers future schemes; specific PQ values return after NIST FIPS 204/205 final status independently verified.
  3. Rename 'smart-account-7702' -> 'delegated-eoa' in RequiredAccountType. Account-shape-typed rather than protocol-typed; removes explicit EIP-7702 protocol-level claim from normative enum.
  4. Close RiskWarning.severity to 'low' | 'medium' | 'high' | 'critical'. Aligns with ERC section 7 closed enumeration.
  5. Close ScannerVerdict.verdict to 'ALLOW' | 'WARN' | 'BLOCK'. Matches RiskAssessment.action vocabulary.

Files touched

  • app/landing/public/schemas/v0.1/envelope.json (new)
  • packages/tx-protocol/scripts/generate-schema.ts (new)
  • packages/tx-protocol/examples/multicall-batch.ts (new)
  • packages/tx-protocol/package.json (version bump + devDeps + script)
  • packages/tx-protocol/CHANGELOG.md (alpha.2 entry)
  • packages/tx-protocol/spec/v0.1/prepared-transaction.md (canonical spec sync)
  • packages/tx-protocol/src/schema.ts (drop version field, drop PQ enums, rename account type, close enums)
  • packages/tx-protocol/src/types.ts (matching type changes)
  • packages/tx-protocol/src/helpers.ts (drop SPEC_VERSION import + usage in create helpers)
  • packages/tx-protocol/src/index.ts (drop SPEC_VERSION + SpecVersion exports)
  • packages/tx-protocol/src/__tests__/validate.spec.ts (assertion updates)
  • packages/ows-adapter/src/__tests__/ows.spec.ts (downstream severity update)
  • pnpm-lock.yaml (devDeps install)

Test plan

  • pnpm --filter @txkit/tx-protocol typecheck clean
  • pnpm --filter @txkit/tx-protocol test 20/20 pass
  • pnpm --filter @txkit/tx-protocol gen:schema writes deterministic output
  • curl https://txkit.dev/schemas/v0.1/envelope.json returns 200 with valid JSON Schema after Vercel auto-deploy lands
  • Verify the worked Permit2 example from ERC section 6.3.1 validates against the published schema
  • Verify examples/multicall-batch.ts envelope output validates against the published schema

Notes

The remaining version properties in the generated schema (Eip712Domain.version) are the EIP-712 typed-data domain version per the EIP-712 specification, not the dropped envelope-level field.

The schema generator runs entirely against the zod source of truth, so any future divergence between the zod runtime validators and the published JSON Schema would be a code review issue rather than a drift risk.

Adds zod-to-json-schema-based generator script that publishes the
PreparedTransaction Envelope v0.1 JSON Schema to the canonical URL
`https://txkit.dev/schemas/v0.1/envelope.json` (served from the landing
app's public directory).

Output drives the normative `$schema` URL referenced by every prepared
envelope per the ERC submission Specification section 1.2. Regenerable
via `pnpm --filter @txkit/tx-protocol gen:schema`.

Initial generation reflects the pre-alpha.2 state of zod sources;
follow-up commit drops the legacy `version` field per locked ERC design
decision.
Bumps `@txkit/tx-protocol` to 0.1.0-alpha.2 with 5 breaking changes
aligning the reference implementation with the ERC submission draft:

1. Drop envelope-level `version: SpecVersion` field. The `$schema` URL
   is the version contract; embedding a redundant version inside the
   envelope was retired during Phase 3 ERC body draft.
2. Drop post-quantum scheme enum entries (`ml-dsa-44`, `ml-dsa-65`,
   `ml-dsa-87`, `slh-dsa-sha2-128s`) from `SignatureScheme`. The open
   string fallback covers future schemes without unverifiable claims;
   specific PQ values return in a follow-up once NIST FIPS 204/205
   final status is independently verified.
3. Rename `requiresAccountType: 'smart-account-7702'` to
   `'delegated-eoa'`. The new value is account-shape-typed rather than
   protocol-typed so future delegation transports do not require new
   enum values; removes the explicit EIP-7702 protocol-level claim
   from the normative enum.
4. Close `RiskWarning.severity` to `'low' | 'medium' | 'high' |
   'critical'`. Aligns with ERC section 7 closed enumeration; replaces
   the previous `INFO | WARN | CRITICAL` set.
5. Close `ScannerVerdict.verdict` to `'ALLOW' | 'WARN' | 'BLOCK'`.
   Matches `RiskAssessment.action` vocabulary in ERC section 7.

Also adds:

- `examples/multicall-batch.ts` demonstrating `evm-batch` kind with
  `atomicRequired: true` capability and multi-call `tokenMovements`
  covering approve + transfer in a single envelope.
- Canonical spec sync at `spec/v0.1/prepared-transaction.md`.
- Updated test fixtures in `validate.spec.ts` and downstream
  consumer adjustment in `packages/ows-adapter`.

Regenerates `app/landing/public/schemas/v0.1/envelope.json` from the
post-bump zod sources; the envelope no longer carries a redundant
`version` field. The remaining `version` properties in the schema are
the `Eip712Domain.version` field per EIP-712 typed-data, not envelope
metadata.

Verification:
- `pnpm --filter @txkit/tx-protocol typecheck` clean
- `pnpm --filter @txkit/tx-protocol test` 20/20 pass
@vercel
Copy link
Copy Markdown

vercel Bot commented May 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
txkit-docs Ready Ready Preview, Comment May 12, 2026 8:02am
txkit-land Ready Ready Preview, Comment May 12, 2026 8:02am
txkit-story Ready Ready Preview, Comment May 12, 2026 8:02am

@mike-diamond mike-diamond merged commit e2a0aa5 into main May 12, 2026
7 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant